<#escape x as x?html>
<style type="text/css">
    .dv-table td {
        border: 0;
    }

    .dv-label {
        font-weight: bold;
        color: #15428B;
        width: 100px;
    }
</style>

<script type="text/javascript">
    function isObtainCredits_click(){
        $.ajax({
            type: "POST",
            url: "study/update/course/" + scheduleId + "/" + electiveWeek + "/" + electiveTime+"/"+$("#isObtainCredit").val(),
            dataType: "json",
            cache: false
        });
    }
</script>

<table class="dv-table" border="0" style="width:100%;">
    <tr>
        <td class="dv-label">出勤情况：</td>
        <td style='color:#888'>共记${attendanceSumCount}次出勤记录，出勤${attendancePassCount}次</td>

        <td class="dv-label">课堂表现情况：</td>
        <td style='color:#888'>共记${behaviorSumCount}次课堂表现记录，合格${behaviorPassCount}次</td>
    </tr>
    <tr>
        <td class="dv-label">作业情况：</td>
        <td style='color:#888'>共记${homeworkSumCount}次作业情况记录，合格${homeworkPassCount}次</td>

        <td class="dv-label">测验情况：</td>
        <td style='color:#888'>共记${examSumCount}次测验记录，合格${examPassCount}次</td>
    </tr>
    <tr>
        <td class="dv-label" >是否获得学分：</td>
        <td style="text-align: left"><input id="isObtainCredit" type="checkbox"></td>
    </tr>
</table>
<script>
    var checked=${isObtainCredits};
    var isObtainCredit=checked;
    if(checked==1){
        $('#isObtainCredit').attr("checked",true);
    }
    var studentId=${studentId};
    $('#isObtainCredit').click(function(){
        if(isObtainCredit==1){
            isObtainCredit=0;
        }else{
            isObtainCredit=1
        }
        $.ajax({
            type: 'POST',
            url: 'study/update/course/' + scheduleId + '/' + electiveWeek + '/'
                    + electiveTime+'/student/'+studentId+'/credits/'+isObtainCredit,
            dataType: 'json',
            cache: false,
            success: function (data) {
                if (data) {
                     if(isObtainCredit==0){
                         $('#isObtainCredit').removeAttr("checked")
                     }
                }
            }
        });
    });
</script>
</#escape>